import client from 'prom-client';

const defaultLabels = { serviceName: 'ra-node-service' };
client.register.setDefaultLabels(defaultLabels);

// 请求次数计数
const reqCounter = new client.Counter({
  name: 'reqCounter',
  help: '请求次数',
});

// 并发量
const concurrentGauge = new client.Gauge({
  name: 'concurrentGauge',
  help: '并发量',
});

// 持续时间
const durationTimeHistogram = new client.Histogram({
  name: 'durationTimeHistogram',
  help: '响应时间',
  buckets: [0.01, 0.1, 1, 5, 10, 50],
});

export default { reqCounter, concurrentGauge, durationTimeHistogram };
